<template>
	<view class="login-container">
		<!-- 密码登录 -->
		<userpwd v-show="loginPwd" @loginSuccess="loginSuccess"/>
		
		<!-- 注册 -->
		<view class="content_login_register">
			<u-icon name="plus-people-fill" color="#5ac725" size="40" @tap="toRegisterPage"></u-icon>
		</view>
	</view>
</template>

<script>
	import userpwd from './components/userpwd.vue'
	
	export default {
		name: 'LoginPage',
		components: {
			userpwd
		},
		data() {
			return {
				loginPwd: true
			}
		},
		methods: {
			// 账号注册
			toRegisterPage(){
				uni.navigateTo({
					url: '/pages/login/register'
				})
			},
			// 登录成功
			loginSuccess() {
				// 登录成功跳到首页
				uni.navigateTo({
					url: '/pages/main/main'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.login-container {
		width: 100%;
		height: calc(100vh - 0px);
		background-image: url(@/static/index.png);
		background-size: cover;
		background-repeat: no-repeat;
		overflow: hidden;
		
		.content_login_register {
			margin-top: 30px;
			display: flex;
			justify-content: center;
			overflow: hidden;
		}
	}
</style>
